var table = null;
var pid, tid;
layui
    .config({
        base: '../layui/exts/', //静态资源所在路径
    })
    .use(['table', 'form'], function () {
        let form = layui.form;
        $ = layui.$;
        let table = layui.table;
        let pid = $("#projectList").val();
        let tid = '';
        openTaskData(table, pid);
        form.render();
        form.on("select(projectList)", function (data) {
            pid = data.value;
            openTaskData(table, pid);
        });

        //监听工具条
        table.on("row(taskTable)", function (obj) {
            let data = obj.data;
            obj.tr.addClass("layui-table-click").siblings().removeClass("layui-table-click");
            tid = data.id;
            let url = "?pid=" + pid + "&tid=" + tid + "&classId=" + obj.data.archivesClassifyId;

            if (obj.data.fillingModel === null || obj.data.fillingModel === "" || obj.data.fillingModel === undefined) {
                window.frames['archivesIframe'].location.href = "./archivesHome";
            } else if (obj.data.fillingModel === "3") {
                window.frames['archivesIframe'].location.href = "./archivesProject" + url;
            } else if (obj.data.fillingModel === "2") {
                window.frames['archivesIframe'].location.href = "./archivesFile" + url;
            } else if (obj.data.fillingModel === "1") {
                window.frames['archivesIframe'].location.href = "./archivesRecord" + url;
            }
        });
    });